﻿@model SimpleForum.Data.Models.ViewModels.UserViewModel

<div class="align-left" style="text-align:center;width:200px;" id="user-avatar">
    @Html.DisplayFor(x => x.User, "User.Full")
</div>

<div class="align-left" style="width:325px;">
    <table style="width:100%;">
        <tr>
            <td>name</td>
            <td><strong>@Model.User.UserName</strong></td>
        </tr>
        <tr>
            <td>member for</td>
            <td>@Model.User.DateCreated.TimeAgo(false)</td>
        </tr>
        <tr>
            <td>last seen</td>
            <td>@Model.User.DateLastActivity.Value.TimeAgo()</td>
        </tr>
        @if (Model.IsSelf) {
        <tr>
            <td>e-mail</td>
            <td>@Model.User.Email</td>
        </tr>
        }
        @if (Model.User.FacebookUsername != null) {
        <tr>
            <td>Facebook</td>
            <td><a href="http://www.facebook.com/@Model.User.FacebookUsername" title="Visit @Model.User.UserName's facebook page" target="_blank" rel="nofollow"><img src="@Url.ThemeContent("Images/icons/facebook.png")" alt="facebook" style="vertical-align:middle;" /> @Model.User.FacebookUsername</a></td>
        </tr>
        }
        @if (Model.User.TwitterUsername != null) {
        <tr>
            <td>Twitter</td>
            <td><a href="http://www.twitter.com/@Model.User.TwitterUsername"  title="Visit @Model.User.UserName's twitter page" target="_blank" rel="nofollow"><img src="@Url.ThemeContent("Images/icons/twitter.png")" alt="twitter" style="vertical-align:middle;" /> @Model.User.TwitterUsername</a></td>
        </tr>
        }
    </table>
</div>

<div id="bio" class="align-right" style="width:400px;">
    <div style="background-color:#eee;height:200px;padding:5px;">
        @if (Model.User.Bio == null && Model.IsSelf) {
            <div id="bio-text" style="line-height:200px;cursor:pointer;">(click here to create a bio)</div>
        } else {
            <div id="bio-text">@Html.Markdown(Model.User.Bio)</div>
        }

        @if (Model.IsSelf) {
        <div id="update-bio" class="hidden">
            <textarea style="width:99%;height:150px;">@Model.User.Bio</textarea>
            <span class="light-grey align-left">you can use Markdown here</span>
            <button type="button" class="align-right">save</button>
        </div>
        }
    </div>
</div>

<span class="clearfix">&nbsp;</span>